<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        table{
            text-align: center;
            width: 100%;

        }
    </style>
</head>
<body>
{#<form action="/hn/find/" method="post">#}
{#    <input type="text" name = 'code0'>开奖号码1#}
{#    <input type="text" name = 'code1'>开奖号码2#}
{#    <input type="text" name = 'code2'>开奖号码3#}
{#    <input type="submit" value="查询">#}
{#</form>#}
<div>
<table id = 'a123'>
    <tr>
    <th>ID</th>
    <th>期号</th>
    <th>开奖号码1</th>
    <th>开奖号码2</th>
    <th>开奖号码3</th>
    <th>重号</th>
    <th>一期号</th>
    <th>二期号</th>
    <th>三期号</th>
    <th>四期号</th>
    <th>五期号</th>
    <th>六期号</th>
    <th>超六期号</th>
    <th>时间</th>
    </tr>

</table>
</div>
</body>
<script type="text/javascript"  src="/static/js/jquery-3.2.1.js"></script>
<script>
    function get_index_date() {
            console.log("请求准备发送");
            $.ajax({
                type : "POST",
                url : "/hn/search_all/",
                dataType : "json",
                success : function(data) {
                    var obj = eval(data) {#  格式化请求的数据#}
{#                    console.log(obj.length)#}
{#                    console.log(obj)#}
                    $.each(obj,function (i,item) {
{#                        console.log(i)    {#  id#}
{#                        console.log(item['fields']) {#  获得字典#}
                        var data_dit = item['fields']
{#                        console.log(i,data_dit['lusse'],data_dit['code_0'],data_dit['code_1'],data_dit['code_2'],data_dit['double_num'],data_dit['one_num'],data_dit['two_num'],data_dit['three_num'],data_dit['four_num'],data_dit['five_num'],data_dit['six_num'],data_dit['super_six_num'],data_dit['create_time'])#}
{#                        console.log('--------------')#}
                        var data_show = " <tr><td>"+i+"</td><td>"+data_dit['lusse']+"</td><td>"+data_dit['code_0']+"</td><td>"+data_dit['code_1']+"</td><td>"+data_dit['code_2']+"</td><td>"+data_dit['double_num']+"</td><td>"+data_dit['one_num']+"</td> <td>"+data_dit['two_num']+"</td> <td>"+data_dit['three_num']+"</td> <td>"+data_dit['four_num']+"</td> <td>"+data_dit['five_num']+"</td> <td>"+data_dit['six_num']+"</td><td>"+data_dit['super_six_num']+"</td><td>"+data_dit['create_time']+"</td></tr>"
{#                        console.log(data_show)#}
                        $("#a123").append(data_show)
                    })
                },
            });
        }
    get_index_date()
    setInterval(get_index_date,600000)

    function update_k3_to_sql() {
        $.ajax({
         type : "POST",
        url : "/hn/update/",
        dataType : "json",
            success:function(){
                console.log('数据更新成功')
            }
        })
{#        update_k3_to_sql()#}
    }
    setInterval(update_k3_to_sql,600000)

{#    function test() {#}
{#        console.log('test')#}
{#    }#}
{#    setInterval(test,10000)#}
</script>
</html>